﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace DataObjects.ADO
{
    public class SqlBaoCaoTraTre
    {        
        public SqlBaoCaoTraTre()
        {            
        }

        public DataTable GetTable()
        {
            return Db.Read("sp_BC_SACHTRATRE");
        }

        public string Insert()
        {
            return Db.ExecuteStoreProcedure("sp_BC_SACHTRATRE_insert", null);
        }

        public DataTable GetKey()
        {
            return Db.Read("sp_BC_SACHTRATRE_selectKey");
        }

        public DataTable GetTableByDate(string ngayBC)
        {
            SqlParameter par = new SqlParameter("@NgayBC", ngayBC);
            object[] parms = new object[1];
            parms[0] = par;
            return Db.Read("sp_BC_SACHTRATRE_select", parms);
        }

        public string Delete(string ngayBC)
        {
            SqlParameter par = new SqlParameter("@NgayBC", ngayBC);
            object[] parms = new object[1];
            parms[0] = par;
            return Db.ExecuteStoreProcedure("sp_BC_SACHTRATRE_delete", parms);
        }
    }
}
